#include "complex.h"
int i=-1;
Complex::Complex(double rea,double img):re(rea),im(img){
}
double Complex::getReal()const{
  return (*this).re;
}
double Complex::getImag()const{
	return (*this).im;
}
void Complex::setReal(double rea){
	(*this).re=rea;
}
void Complex::setImag(double ima){
	(*this).im=ima;
}
std::ostream& operator <<(std::ostream& out,Complex& right){
	out<<"Re= "<<right.re<<" Im= "<<right.im<<"\n";
}
VectorComplex::VectorComplex(Complex& nr){	
	v[++i]=nr;
}
Complex VectorComplex::operator =(Complex& right){
	v[i].setReal(right.getReal());
	v[i].setImag(right.getImag());
}
std::ostream& operator <<(std::ostream& out,VectorComplex& v){
	for(int it=0;it<=i;it++)
		{
			out<<"\nV["<<it<<"] Re= "<<v.v[it].getReal();
			out<<"\n";
			out<<"V["<<it<<"] Im= "<<v.v[it].getImag();
		}
}
void VectorComplex::add(Complex& nr1){
	v[++i]=nr1;	
}
Complex VectorComplex::suma(){
	double x=0.0,y=0.0;
	for(int it=0;it<=i;it++)
		{		
			x=x+v[it].getReal();
			y=y+v[it].getImag();
		}
	Complex nr(x,y);
	return nr;
}
Complex Complex::operator ++(Complex& right){
	++right.re;
	++right.im;
}
